<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="style.css">
    <title>好看的开关按钮</title>
    <style>
        .app {
            width: 100%;
            height: 100vh;
            background-color: #ffffff;
            position: relative;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .label33 {
            width: 60px;
            height: 32px;
            position: relative;
            cursor: pointer;
        }

        .inp33 {
            display: none;
        }

        .check-span33 {
            width: 100%;
            height: 100%;
            display: block;
            background-color: #383838;
            border-radius: 16px;
            transition: 0.3s linear;
        }

        .check-span33:after {
            content: '';
            width: 22px;
            height: 22px;
            border: 6px solid greenyellow;
            border-radius: 11px;
            position: absolute;
            top: 5px;
            left: 6px;
            box-sizing: border-box;
            transition: 0.3s ease-in-out;
        }

        .inp33:checked+.check-span33 {
            background-color: green;
        }

        .inp33:checked+.check-span33:after {
            transform: translateX(26px);
            border: 6px solid white;
        }
    </style>
</head>

<body>
    <div class="app">
        <label class="label33">
            <input class="inp33" type="checkbox">
            <span class="check-span33"></span>
        </label>
    </div>
</body>

</html>